﻿Public Class frmChonGhe
    

    Public Sub Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Dim btn As Button = DirectCast(sender, Button)

        Dim str As String() = btn.Text.Split(New Char() {":"})
        Dim i As Integer = str(1) - 1
        Dim j As Integer = str(0) - 1

        If Frm_Login.arr(i, j).st = 0 Then
            Frm_Login.arr(i, j).st = 2
            Frm_Login.arr(i, j).sl.BackgroundImage = RapChieuPhim.My.Resources.Resources.seat_2___Copy
        Else
            Frm_Login.arr(i, j).st = 0
            Frm_Login.arr(i, j).sl.BackgroundImage = RapChieuPhim.My.Resources.Resources.seat_0
        End If
    End Sub

    Private Sub btnChon_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnChon.Click
        For i = 0 To 9 Step 1
            For j = 0 To 9 Step 1
                If Frm_Login.arr(i, j).st = 2 Then
                    Dim str As String() = Frm_Login.arr(i, j).sl.Text.Split(New Char() {":"})
                    Frm_Login.banve.SoHang = str(0)
                    Frm_Login.banve.SoDay = str(1)

                    Dim bus As New VeBUS()
                    bus.Insert(Frm_Login.banve)

                    Frm_NhanVienBanVe.gvVe_Load()
                    Frm_KhachHang.gvVe_Load()
                End If
            Next
        Next
        MessageBox.Show("Hoàn tất mua(đặt) vé!!!")
        Me.Close()
    End Sub

    Private Sub frmChonGhe_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub
End Class